﻿using System;
using System.IO;

namespace Hongsh.Pay.Client.Proxy.Http {
    // Token: 0x02000027 RID: 39
    public class HttpRequestHeader : HttpHeader {
        // Token: 0x17000074 RID: 116
        // (get) Token: 0x06000120 RID: 288 RVA: 0x00002C58 File Offset: 0x00000E58
        public string Method { get; }

        // Token: 0x17000075 RID: 117
        // (get) Token: 0x06000121 RID: 289 RVA: 0x00002C60 File Offset: 0x00000E60
        public string Path { get; }

        // Token: 0x17000076 RID: 118
        // (get) Token: 0x06000122 RID: 290 RVA: 0x00002C68 File Offset: 0x00000E68
        public string Host {
            get {
                return base["Host"];
            }
        }

        // Token: 0x06000123 RID: 291 RVA: 0x0000B5F4 File Offset: 0x000097F4
        public HttpRequestHeader(string header) : base() {
            //Class15.cwcZ3SWztHroi();
            //base..ctor();
            StringReader stringReader = new StringReader(header);
            string text = stringReader.ReadLine();
            string[] array = text.Split(new char[]
            {
                ' '
            }, 3);
            Method = array[0];
            Path = array[1];
            Version = array[2];
            string text2;
            while ((text2 = stringReader.ReadLine()) != null) {
                if (text2.Length > 0) {
                    string[] array2 = text2.Split(new char[]
                    {
                        ':'
                    }, 2);
                    string text3 = array2[0].Trim();
                    if (text3.Equals("Content-Type", StringComparison.OrdinalIgnoreCase)) {
                        text3 = "Content-Type";
                    }
                    base[text3] = (array2.Length == 2) ? array2[1].Trim() : null;
                }
            }
        }
    }
}
